<template>
	<view class="">
		<view class="" style="background-color: white;display: flex;align-items: center;padding: 20px 20px;">
			<image :src="avatar" @error="err" style="height: 60px;width: 60px;border-radius: 60px;" />
			<view class="" style="margin-left: 10px;">{{user.nickName}}</view>
		</view>
		<view class="container">
			<uni-list style="margin-top: 10px;">
				<uni-list-item :thumb="item.thumb" v-for="item in list" :to="item.to" link :title="item.title">
				</uni-list-item>
			</uni-list>
			<button type="warn" @click="submit" style="margin-top: 20px;">退出</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {},
				avatar: "",
				list: [{
						to: "info/info",
						title: "个人信息",
						thumb: "/static/personal.png"
					},
					{
						to: "pwd/pwd",
						title: "修改密码",
						thumb: "/static/pwd.png"
					},
					{
						to: "feed/feed",
						title: "意见反馈",
						thumb: "/static/feed.png"
					}
				]
			};
		},
		onLoad(item) {

		},
		onReady() {

		},
		onShow() {
			this.user = uni.getStorageSync("user")
			this.avatar = this.baseUrl + "/prod-api" + this.user.avatar
		},
		methods: {
			err() {
				this.avatar = "/static/tx.png"
			},
			submit() {
				uni.reLaunch({
					url: "../index/index"
				})
			},
		}
	};
</script>

<style lang="scss">

</style>
